extends "../i_TD_shoe_Hide/i_TD_shoe_Hide.gd"

func init():
    .init()
    name = "极速鞋·闪"
    resetdata()
    info = "极速闪：当自身血量少于33%的时候，被攻击有20%概率清除全部仇恨并随机转移到自身方阵随机位置[cd:5秒]\n" + info
#链接信号
func _connect():
    ._connect()
    masCha.connect("onHurt",self,"jss")
#技能计时
func _upS():
    ._upS()
    if flag3:return
    cnt3 += 1
    if cnt3 == 5:
        cnt3 = 0
        flag3 = 1
#极速闪
func jss(atkinfo):
    if masCha.att.hp / masCha.att.maxHp > 0.33:return
    if atkinfo.isMiss || !flag3 || sk1:return
    if sys.rndPer(20):
        flag3 = 0
        var chas = masCha.getAllChas(1)
        for i in chas:
            if i.aiCha == masCha:
                i.aiCha = null
        var cells = utils.cellsLeft
        if masCha.team == 2:cells = utils.cellsRight
        var tmp =  1
        while(tmp):
            var v = sys.rndListItem(cells)
            var cha = sys.main.matCha(v)
            if cha == null:
                if masCha.setCell(v):
                    var pos = sys.main.map.map_to_world(v)
                    masCha.ying(pos,masCha.position)
                    masCha.position = pos
                    masCha.aiCha = null
                    tmp = 0
                    break